import cv2

import potrace
import numpy as np
import cv2
from PIL import Image  # #调用库
filePath = "./bmp/22.jpg"

im1 = Image.open(filePath).convert('1')  # #文件存在的路径
data = np.array(im1)
print(data)

image = cv2.imread(filePath)
print(image)
thresh = 120
imgray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)  # 彩色转灰度
ret, im2 = cv2.threshold(imgray, thresh, 255, cv2.THRESH_BINARY)  # 输入灰度图，输出二值图
print(im2)
